/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package it.allerj.model;

import it.allerj.common.persistence.PersistenceObject;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Alessandro Veracchi
 */
public class RowMatrix extends PersistenceObject {
    private List<CellMatrix> cellList = new ArrayList<CellMatrix>();

   
    //ONLY FOR HIBERNATE
    public RowMatrix(){
       
    }
    public RowMatrix(int lenght){
        this.cellList = new ArrayList(lenght);
    }

    public void addCell(CellMatrix cell){
        if(getCellList()==null)
            return ;
        getCellList().add(cell); 
    }
    public void setCell(CellMatrix cell, int position){
        if(getCellList()==null || position<0 || position>=getCellList().size() )
            return ;
           getCellList().set(position, cell); 
    }
    public CellMatrix getCell(int position){
         if(getCellList()==null || position<0 || position>=getCellList().size() )
             return null;
         return getCellList().get(position);
    }

    public List<CellMatrix> getCellList() {
        return cellList;
    }

    public void setCellList(List<CellMatrix> elementList) {
        this.cellList = elementList;
    }
}
